﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkMajorEnter.aspx.cs" Inherits="WorkRecord.WorkMajorEnter" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>录入本月重点工作</title>
    <script src="/Static/js/jquery-1.11.1.min.js"></script>
    <link href="/Static/css/style.css" rel="stylesheet" type="text/css" />
    <script src="/Static/js/share.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <br />
        <div class="center" style="width: 80%;">
            <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tabline">
                <tr>
                    <td colspan="2" align="center" style="height: 30px;">
                        <h3>
                            本月重点工作录入</h3>
                    </td>
                </tr>
                
                <tr>
                    <td colspan="2">
                        <asp:TextBox runat="server" ID="txtContent" TextMode="MultiLine" Width="300px" Style="width: 98%;"
                                        Rows="2" onpropertychange="ResizeTextarea(this)" oninput="ResizeTextarea(this)"
                                        onkeyup="ResizeTextarea(this)"></asp:TextBox>
                    </td>
                </tr>
                
                <tr>
                    <td colspan="2" align="center" class="tabbt">
                        <asp:Button ID="btnSubmit" runat="server" CssClass="js_btn" Text="提 交" OnClick="btnSubmit_Click" />
                        <input type="button" id="btnBack" onclick='window.location.href="/WorkView.aspx"' value="返 回" />
                    </td>
                </tr>
            </table>
        </div><br />
    </form>
</body>
</html>
<script type="text/javascript">
    // 最小高度 
    var minHeight = 40;
    // 最大高度，超过则出现滚动条 
    var maxHeight = 3000;
    function ResizeTextarea(Control) {
        var t = Control;
        var h = t.scrollHeight;
        h = h > minHeight ? h : minHeight;
        h = h > maxHeight ? maxHeight : h;
        t.style.height = h + "px";
    }
    $(".js_btn").click(function() {
        try {
            var content = $("#<%=txtContent.ClientID %>").val();
        } catch(e) {
            ;
        }
        var content_exist = $(".js_content_exist").length;
        if (content == "" && content_exist == 0) {
            alert("请将信息填写完整");
            return false;
        }
        return true;
    });
    window.setTimeout("AutoFixAllHeight()", 100);
</script>
